package cn.ac.jaas.ljx.java.dynamicProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class ProxyHandler implements InvocationHandler {

	private Object proxied;
	
	public ProxyHandler(Object proxied) {
		this.proxied = proxied;
	}
	
	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		System.out.println("do other things before proxy real");
		//proxy.toString();
		//Object result = null;
		method.invoke(proxied, args);
		System.out.println("do other things before proxy real");
		//System.out.println(result);
		return new Object();
	}

}
